package com.gomore.opple.module.orderpay;


import com.gomore.opple.BasePresenter;
import com.gomore.opple.BaseView;
import com.gomore.opple.model.Action;
import com.gomore.opple.model.WeChatData;
import com.gomore.opple.rest.employee.LoginResult;
import com.gomore.opple.rest.order.OrderBill;
import com.gomore.opple.rest.order.OrderPayRequest;
import com.gomore.opple.rest.order.RsOrderShareResponse;
import com.gomore.opple.web.cgform.consumer.entity.TOConsumerEntity;
import com.gomore.opple.web.cgform.orderpromotion.entity.TOOrderPromotionEntity;
import com.gomore.opple.web.system.pojo.TOReseller;

import java.util.List;

public interface OrderPayContract {

    interface View extends BaseView<Presenter> {

        /**
         * 显示进度条
         */
        void showProgressDialog();

        /**
         * 隐藏进度条
         */
        void hideProgressDialog();

        /**
         * 展示消息
         *
         * @param msg 消息
         */
        void showMessage(String msg);

        /**
         * 展示消息
         *
         * @param msgId 消息id
         */
        void showMessage(int msgId);

        /**
         * 展示订单详情
         *
         * @param orderBill
         */
        void showContentView(OrderBill orderBill, int isView);

        /**
         * 展示客户信息
         *
         * @param toConsumerEntity
         */
        void showConsumerView(TOConsumerEntity toConsumerEntity);

        /**
         * 展示选择条件
         */
        void showConditionSelect();

        /**
         * 支付界面
         *
         * @param payMethod
         * @param toReseller
         */
        void showCodeDialog(String payMethod, TOReseller toReseller);

        /**
         * 展示分享界面
         */
        void showShareView();

        /**
         * 跳转到订单页面
         */
        void goToOrderActivity();

        /**
         * 操作促销选择
         */
        void doActions();

        /**
         * 支付完成弹框
         */
        void showResultDialog();

        /**
         * 展示订单促销记录
         */
        void showOrderPromotionContent();

    }

    interface Presenter extends BasePresenter {

        /**
         * 准备初始化数据
         */
        void prepareInitData();

        /**
         * 获取订单
         *
         * @param order_number
         */
        void getOrder(String order_number, String promotionType, int isView);

        /**
         * 获取促销结果
         */
        void getCalc(String orderNumber);

        /**
         * 获取顾客筛选条件
         *
         * @return
         */
        List<Action> getConsumerActionData();

        /**
         * 获取导购筛选条件
         *
         * @return
         */
        List<Action> getGuideActionData();

        /**
         * 获取经营者二维码
         */
        void getReseller(String payMethod);

        /**
         * 获取用户信息
         *
         * @return
         */
        LoginResult getUser();

        /**
         * 确定支付订单
         *
         * @param orderPayRequest
         * @param orderNumber
         * @param promotionType
         * @param isView
         */
        void payOrder(OrderPayRequest orderPayRequest, String orderNumber, String promotionType, int isView);

        /**
         * 分享订单
         *
         * @param order_number
         */
        void shareOrder(String order_number);

        /**
         * 获取分享的连接
         *
         * @return
         */
        RsOrderShareResponse getShareUrl();

        /**
         * 更新订单状态
         *
         * @param orderNumber
         * @param oldState
         * @param newState
         */
        void updateOrderState(String orderNumber, String oldState, String newState, String promotionType, int isView);

        /**
         * 使用微信卡卷
         *
         * @param cardNumber
         * @param orderNumber
         * @param orderTotal
         */
        void getWenChat(String cardNumber, String orderNumber, String orderTotal);

        /**
         * 获取微信卡卷结果
         *
         * @return
         */
        WeChatData getWeChatData();

        /**
         * 获取订单促销记录
         *
         * @param orderNumber
         */
        void getOrderPromotion(String orderNumber);

        /**
         * 获取订单历史促销记录
         *
         * @return
         */
        List<TOOrderPromotionEntity> getOrderPromotionData();
    }
}
